home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / SHARED.DIR / 01021_Script_Menu code < prev    next >
Text File  |  1995-11-21  |  11KB  |  468 lines

  1. on showOverheadMenu
  2.   global gOverheadMenuP, gMenuVolume
  3.   
  4.   
  5.   if the machineType = 256 then
  6.     runPCMenuBar
  7.   else
  8.     set gOverheadMenuP = 1
  9.     installMenu cast "Main Overhead Menu"
  10.     
  11.     set the checkMark of menuItem (gMenuVolume + 1) of menu "volume" = 1
  12.   end if
  13.   
  14. end showOverheadMenu
  15.  
  16. on runPCMenuBar
  17.   global gMenuVolume
  18.   
  19.   set curSel = 0
  20.   
  21.   set h = 0
  22.   set w = 30
  23.   if the mouseH < h+w then set cn = the number of cast "Menu1"
  24.   else
  25.     set h = h+w
  26.     set w = 70
  27.     if the mouseH < h+w then set cn = the number of cast "Menu2"
  28.     else
  29.       set h = h+w
  30.       set w = 61
  31.       if the mouseH < h+w then 
  32.         set cn = the number of cast "Menu3"
  33.         set curSel = gMenuVolume+2
  34.       end if
  35.     end if
  36.   end if
  37.   
  38.   if voidP(cn) then exit
  39.   
  40.   set cnTemp = the number of cast "temp menu"
  41.   
  42.   copyToClipBoard cast cn
  43.   pasteClipBoardInto cast cnTemp
  44.   set the name of cast cnTemp = "temp menu"
  45.   
  46.   copyToClipBoard cast (cn+1)
  47.   pasteClipBoardInto cast (cnTemp+1)
  48.   set the name of cast (cnTemp+1) = "temp menua"
  49.   
  50.   set cn = cnTemp
  51.   
  52.   set sel = doDMDPopMenu2(cn, h, h+w, 1, curSel) 
  53.   --  --put ">>> runPCMENUBar sel = " sel
  54.   
  55.   if sel > 1 then 
  56.     set command = line (sel - 1) of field (cnTemp+1)
  57.     --    --put ">>>" & command
  58.     do command
  59.   end if
  60. end runPCMenuBar
  61.  
  62.  
  63. on hideOverheadMenu
  64.   global gOverheadMenuP
  65.   
  66.   --  if the stageTop <> 0 then exit
  67.   
  68.   set gOverheadMenuP = 0
  69.   
  70.   if the machineType <> 256 then installMenu 0
  71. end hideOverheadMenu
  72.  
  73. on testOverheadMenu  
  74.   global gOverheadMenuP
  75.   
  76.   if char 1 of the movie = "_" then exit
  77.   
  78.   if the machineType <> 256 then
  79.     --
  80.     --
  81.     -- Macs
  82.     --
  83.     if the stageTop <> 0 then
  84.       if the mouseV < 0 then
  85.         if not gOverheadMenuP then 
  86.           showOverheadMenu
  87.         end if
  88.         
  89.       else if gOverheadMenuP then hideOverheadMenu      
  90.       
  91.       exit
  92.     end if
  93.     
  94.     --
  95.     --
  96.     -- If the mouse is between 0 and 20 for more than a second  -- TBD timing
  97.     -- bring up the overhead menu
  98.     --  
  99.     if the mouseV < -1 or the mouseV > 20 then 
  100.       if gOverheadMenuP then hideOverheadMenu
  101.       exit
  102.     else
  103.       if not gOverheadMenuP then showOverheadMenu
  104.     end if
  105.   else
  106.     --
  107.     --
  108.     -- PCs
  109.     --
  110.     if the mouseH > 0 and the mouseV >= 0 and the mouseV <= 20 then showOverheadMenu
  111.   end if
  112.   
  113. end testOverheadMenu
  114.  
  115. on changeVolume newVol
  116.   global gVolume, gMenuVolume
  117.   
  118.   if the machineType <> 256 then
  119.     set the checkMark of menuItem (gMenuVolume + 1) of menu "volume" = 0
  120.     set gMenuVolume = newVol
  121.     set the checkMark of menuItem (gMenuVolume + 1) of menu "volume" = 1
  122.   else
  123.     set gMenuVolume = newVol
  124.   end if
  125.   
  126.   set gVolume = getAt([0, 7, 15, 22, 31, 44, 63, 80, 127, 180, 255], gMenuVolume+1)
  127.   
  128.   if the type of sprite 10 = 16 then
  129.     set cn = the castNum of sprite 10
  130.     if the castType of cast cn = #digitalVideo then set the volume of sprite 10 = gVolume
  131.   end if
  132.   
  133.   if the type of sprite 12 = 16 then
  134.     set cn = the castNum of sprite 12
  135.     if the castType of cast cn = #digitalVideo then set the volume of sprite 12 = gVolume
  136.   end if
  137.   
  138.   if the type of sprite 48 = 16 then
  139.     set cn = the castNum of sprite 48
  140.     if the castType of cast cn = #digitalVideo then set the volume of sprite 48 = gVolume
  141.   end if
  142.   
  143. end changeVolume
  144.  
  145. on goGOMain
  146.   hideOverheadMenu
  147.   updateStage
  148.   
  149.   if the movie = "TOUR.DIR" then stopTour
  150.   else if the movie = "MOVIES.DIR" then stopMovies
  151.   
  152.   if the frameLabel <> "TOCM" then goGo("TOCM")
  153. end goGOMain
  154.  
  155.  
  156. --
  157. --
  158. -- Go to a major section from the menu BUT, if we are
  159. -- at the main TOCM screen, then do the morph first.
  160. --
  161. on goGOm theLabel
  162.   
  163.   hideOverheadMenu
  164.   updateStage
  165.   
  166.   if the movie = "TOUR.DIR" then stopTour
  167.   else if the movie = "MOVIES.DIR" then stopMovies
  168.   
  169.   if theLabel = the frameLabel then exit
  170.   if theLabel&"M" = the frameLabel then exit
  171.   
  172.   if (the movie = "TOC.DIR") and (theLabel = "P") and ((char 1 of the frameLabel) = "P") then exit
  173.   
  174.   --
  175.   --
  176.   -- If at the main screen do the morph
  177.   --
  178.   if the frameLabel = "TOCM" then
  179.     myGo(theLabel)
  180.   else
  181.     goGo(theLabel & "M") -- just go there
  182.   end if 
  183. end goGOm
  184.  
  185. on returnFromHelp
  186.   global gReturnFromHelpFrame, gHelpStart, gHelpPalette, gFixPalShared
  187.   global gCom, gNavPalette
  188.   
  189.   if gHelpStart + 60 > the ticks then exit
  190.   
  191.   if the movie <> "STARMAP.DIR" then
  192.     tell gHelpPalette to lCloseHelpPalette    
  193.     tell gHelpPalette to go to the frame - 2
  194.   end if
  195.   
  196.   if the machineType <> 256 then
  197.     if voidP(gFixPalShared) then setupFixPal
  198.     
  199.     gFixPalShared(mPatchIt)
  200.   end if
  201.   
  202.   go to gReturnFromHelpFrame
  203.   
  204.   if gCom then
  205.     tell gNavPalette to lOpenNavPalette
  206.   end if
  207.   
  208. end returnFromHelp
  209.  
  210. on doHelp
  211.   global gHelpPalette
  212.   global gReturnFromHelpFrame
  213.   global gHelpStart
  214.   global gFixPalShared, gNavPalette, gCom, gFiorellaOnStage
  215.   
  216.   hideOverheadMenu
  217.   updateStage
  218.   
  219.   if gFiorellaOnStage then stopHelp
  220.   
  221.   if the movie = "TOUR.DIR" then stopTour
  222.   else if the movie = "MOVIES.DIR" then stopMovies
  223.   
  224.   if the type of sprite 10 = 16 then
  225.     set cn = the castNum of sprite 10
  226.     if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
  227.   end if
  228.   
  229.   if the movie = "FIND.DIR" and the frameLabel = "Glossary" then 
  230.     set m = "_GLOSS.DIR"
  231.     set f = 1
  232.   else
  233.     set m = the movie
  234.     set f = the frameLabel
  235.   end if
  236.   
  237.   set gReturnFromHelpFrame = the frame
  238.   
  239.   if the movie <> "STARMAP.DIR" and voidP(gHelpPalette) then createHelpPalette  
  240.   
  241.   if the machineType <> 256 then
  242.     if voidP(gFixPalShared) then setupFixPal
  243.     
  244.     gFixPalShared(mPatchIt)
  245.   end if
  246.   
  247.   if gCom then
  248.     tell gNavPalette to lCloseNavPalette(1)  
  249.   end if
  250.   
  251.   
  252.   if the movie <> "STARMAP.DIR" then 
  253.     tell gHelpPalette to lOpenHelpPalette(m, f)  
  254.   end if
  255.   
  256.   set hLabel = label("Help Frame")
  257.   
  258.   if hLabel <> 0 then
  259.     go to hLabel
  260.   else
  261.     go to the frame + 1
  262.   end if
  263.   
  264.   set gHelpStart = the ticks
  265.   
  266. end doHelp
  267.  
  268. on hideSprites
  269.   repeat with i = 1 to 48
  270.     set the visibility of sprite i = 0
  271.   end repeat
  272. end
  273.  
  274.  
  275.  
  276. on doQuit
  277.   global gCom, gNavPalette, gCurHist, gCurData, gGlossPalette
  278.   global gFiorellaOnStage
  279.   
  280.   hideOverheadMenu
  281.   updateStage
  282.   
  283.   if gFiorellaOnStage then stopHelp
  284.   
  285.   if the movie = "TOUR.DIR" then stopTour
  286.   else if the movie = "MOVIES.DIR" then stopMovies  
  287.   
  288.   if the type of sprite 10 = 16 then
  289.     set cn = the castNum of sprite 10
  290.     if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
  291.   end if
  292.   
  293.   if the movie = "FIND.DIR" and not voidP(gGlossPalette) then
  294.     tell gGlossPalette to lCloseGlossPalette
  295.   end if
  296.   
  297.   if gCom then 
  298.     tell gNavPalette to lCloseNavPalette(1)
  299.     
  300.     set the visibility of sprite 22 = 0
  301.     set the visibility of sprite 23 = 0
  302.     set the visibility of sprite 24 = 0
  303.     set the visibility of sprite 25 = 0
  304.     
  305.     go to objectLabel()
  306.     if gCurHist=0 then unGrayHist
  307.     if gCurData=0 then unGrayData
  308.     
  309.   else
  310.     puppetTransition 52,8,8
  311.   end if
  312.   
  313.   hideSprites 1,48
  314.   go to label("Black Frame")
  315.   
  316.   
  317.   fadeSoundChan(1)  
  318.   
  319.   go to movie "FINCREDS"  
  320.   
  321.   --  if gCom then
  322.   --    tell gNavPalette to lOpenNavPalette
  323.   --    set the visibility of sprite 22 = 1
  324.   --    set the visibility of sprite 23 = 1
  325.   --    set the visibility of sprite 24 = 1
  326.   --    set the visibility of sprite 25 = 1
  327.   --  end if
  328.   
  329. end doQuit
  330.  
  331. on doFind
  332.   global gCom, gNavPalette, gCurHist, gCurData, gFiorellaOnStage
  333.   
  334.   --alert "TBD: Find"
  335.   
  336.   hideOverheadMenu
  337.   updateStage
  338.   
  339.   if gFiorellaOnStage then stopHelp
  340.   
  341.   if the movie = "FIND.DIR" and the frameLabel <> "Glossary" then exit
  342.   
  343.   if the movie = "TOUR.DIR" then stopTour(1)
  344.   else if the movie = "MOVIES.DIR" then stopMovies(1)
  345.   
  346.   if the type of sprite 10 = 16 then
  347.     set cn = the castNum of sprite 10
  348.     if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
  349.   end if
  350.   
  351.   
  352.   if gCom then 
  353.     if gCurHist=0 then unGrayHist
  354.     if gCurData=0 then unGrayData
  355.     
  356.     go to objectLabel()
  357.     tell gNavPalette to lCloseNavPalette(1)
  358.   else
  359.     puppetTransition 52,8,8
  360.   end if
  361.   
  362.   addToRetrace
  363.   
  364.   --hideButtons
  365.   hideSprites 1,48
  366.   go to "Black Frame"
  367.   
  368.   go to frame "Black Frame" of movie "FIND.DIR"
  369.   
  370. end doFind
  371.  
  372. on doGlossary
  373.   global gReturnFromGlossFrame, gReturnFromGlossMovie
  374.   global gFixPalShared, gGlossPalette, gGlossOffScreen
  375.   global gCom, gFiorellaOnStage
  376.   
  377.   hideOverheadMenu
  378.   updateStage
  379.   
  380.   if gFiorellaOnStage then stopHelp
  381.   
  382.   if not voidP(gGlossOffScreen) and not gGlossOffScreen then exit
  383.   
  384.   cursor 4
  385.   
  386.   if the movie = "TOUR.DIR" then stopTour(1)
  387.   else if the movie = "MOVIES.DIR" then stopMovies(1)
  388.   
  389.   if the type of sprite 10 = 16 then
  390.     set cn = the castNum of sprite 10
  391.     if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
  392.   end if
  393.   
  394.   if (not gCom) and (the movie <> "FIND.DIR") then
  395.     addToRetrace
  396.     set gReturnFromGlossFrame = the frame
  397.     set gReturnFromGlossMovie = the movie 
  398.     
  399.     hideSprites 1,48
  400.     go to "black frame"
  401.     
  402.     go to movie "SHOWGLOS.DIR"
  403.   end if
  404.   
  405.   if voidP(gGlossPalette) then 
  406.     createGlossPalette 
  407.   end if
  408.   
  409.   tell gGlossPalette to lOpenGlossPalette
  410.   
  411.   cursor -1
  412.   
  413. end doGlossary
  414.  
  415. on AboutIUScreen
  416.   global gAboutGlobal, gReturnFromCredFrame, gReturnFromCredMovie, gCom, gNavPalette
  417.   global gCurHist, gCurData
  418.   
  419.   hideOverheadMenu
  420.   updateStage
  421.   
  422.   if the movie = "TOUR.DIR" then stopTour(1)
  423.   else if the movie = "MOVIES.DIR" then stopMovies(1)
  424.   
  425.   if the type of sprite 10 = 16 then
  426.     set cn = the castNum of sprite 10
  427.     if the castType of cast cn = #digitalVideo then set the movieRate of sprite 10 = 0
  428.   end if
  429.   
  430.   if gCom then 
  431.     if gCurHist=0 then unGrayHist
  432.     if gCurData=0 then unGrayData
  433.     go to objectLabel()
  434.     tell gNavPalette to lCloseNavPalette(1)
  435.   else
  436.     puppetTransition 52,8,8
  437.   end if
  438.   
  439.   set gAboutGlobal = 1
  440.   set gReturnFromCredFrame = the frame
  441.   set gReturnFromCredMovie = the movie
  442.   
  443.   
  444.   go to label("Black Frame")
  445.   
  446.   if gCom then
  447.     set the visibility of sprite 22 = 0
  448.     set the visibility of sprite 23 = 0
  449.     set the visibility of sprite 24 = 0
  450.     set the visibility of sprite 25 = 0
  451.   end if
  452.   
  453.   updateStage
  454.   
  455.   fadeSoundChan(1)  
  456.   
  457.   go to movie "FINCREDS"  
  458.   
  459.   if gCom then
  460.     tell gNavPalette to lOpenNavPalette
  461.     set the visibility of sprite 22 = 1
  462.     set the visibility of sprite 23 = 1
  463.     set the visibility of sprite 24 = 1
  464.     set the visibility of sprite 25 = 1
  465.   end if
  466.   
  467. end AboutIUScreen
  468.